Recently, nonvolatile memories that are data rewritable semiconductor devices have become widely used in many electronic devices such as portable telephone devices and digital cameras. A flash memory that is a typical nonvolatile memory can write data in the memory cells in a nonvolatile fashion by storing charges in the charge storage layer of each memory cell. Also, by erasing the charges in the charge storage layers, the flash memory can erase the data. Some nonvolatile memories have a protecting function for prohibiting data writing and erasing in the memory cells or prohibiting data reading from the cells for purposes of security.
In this specification, data writing (data being “0,” and the threshold voltage of the subject memory cell being increased) or data erasing (data being “1,” and the threshold voltage of the subject memory cell being reduced) is referred to as “programming ” Also, data programming in a memory cell (data being changed from “1” to “0,” or data being changed from “0” to “1”), data writing in a memory cell (data being changed from “1” to “0”), data erasing in a memory cell (data being changed from “0” to “1”), and data reading from a memory cell (data “0” or “1” being output) are referred to as memory cell programming, memory cell writing, memory cell erasing, and memory cell reading, respectively. Data programming, data writing, data erasing, and data reading in the memory cells in a memory region are referred to as memory region programming, memory region writing, memory region erasing, and memory region reading, respectively.
To prohibit programming (data writing or erasing) in memory cells, programming in each of the memory regions may be prohibited or allowed. This function is called the write protection function. To achieve this function, a program prohibition information unit that stores program prohibition information to be used for determining whether to prohibit or allow programming in each memory region is provided for each memory region in a nonvolatile memory.
Japanese Unexamined Patent Application No. 5-266681 discloses a nonvolatile memory that includes a write restricting resistor (equivalent to the program prohibition information unit) that restricts writing in the memory cell array, and a logic circuit that restricts writing in the write restricting resistor.
The technique disclosed in Japanese Unexamined Patent Application No. 5-266681 is applied to a nonvolatile memory that has the function of prohibiting a change of a memory region from a program prohibited state to a program allowed state after the memory region is put into a program prohibited state (in other words, once a program prohibited state is set, the subject memory region serves as a ROM). This function is called the STB (Set Top Box) function. In such a nonvolatile memory, the STB function can be selectively made valid or invalid. To achieve this function, there is ROM information (first prohibition information) to be used for determining whether to prohibit (the memory region is to be turned into a ROM) or allow (the memory region is not to be turned into a ROM) a change of the program prohibition information from a program prohibiting state to a program allowing state, after the program prohibition information is put into a program prohibiting state. The ROM information is stored in a ROM information nonvolatile memory. For example, when a nonvolatile memory is shipped, the ROM information is set in response to a request from the user. Alternatively, only an authorized user can set the ROM information. In this manner, data alteration by a hacker or the like in the ROM memory regions can be prevented.
Japanese Unexamined Patent Application No. 11-213680 discloses a nonvolatile memory that has a latch circuit for each write protected memory circuit (equivalent to each program prohibition information unit) so as to set two or more pieces of write protect information (equivalent to the program prohibition to information). In this nonvolatile memory, the program prohibition information for the write protected memory circuits can be simultaneously set through the latch circuits.
In a nonvolatile memory having the STB function, the usable memory area becomes smaller as many memory regions are put into a program prohibited state (or turned into ROMs). In other words, the working memory area becomes smaller. As a result, the system operation becomes more difficult. For example, if many memory regions are put into a program prohibited state by a hacker or the like, the working memory area becomes smaller, hindering the system operation.